#pragma once
#include <string>
#include "ftd2xx.h"
class SPS2Device
{
public:
	enum
	{
		PKB_EN,
		ILL_EN,
		BUP_EN,
		ACC_EN,
		REV_EN,
		IG_EN,
	};

	SPS2Device();
	~SPS2Device();
	
	bool open();
	bool close();
	bool isOpen();
	void setSwitch(int nSwitchId, bool isOn);
	void setSpeed(int speed);

private:
	int SPI_OutData(BYTE* pBuf, int len);
	FT_HANDLE openSwitchChannel(std::string& channel_name);


private:
	bool is_open_;
	int m_nSwitchStatus;
	int speed_freq_;
	FT_HANDLE m_ftHandle;
	FT_HANDLE m_ftHandleB;
};

